// pages/success/success.js
Page({

  data: {
    second: 15,
    user_name: ""
  },
  timeout: 0,

  onLoad: function (options) {
    this.setData({
      user_name: options.user_name
    })
    var that = this;
    setInterval(() => {
      that.setData({
        second: that.data.second - 1
      })
    }, 1000)
    this.timeout = setTimeout(() => {
      wx.reLaunch({
        url: '/pages/index/index',
      })
    }, 15000)
  },

  handleNow() {
    clearTimeout(this.timeout);
    wx.reLaunch({
      url: '/pages/index/index',
    })
  }
})